<script setup lang="ts">
import { computed, onMounted, ref } from 'vue'
import { getWeatherIconByName, initGetWeatherInfo } from '@/utils/getWeather'
import type { WeatherInfo } from '@/types/base'
import MiniIcon from '@/components/Icon/MiniIcon.vue'
defineOptions({
  name: 'MiniWeather',
})
const props = withDefaults(
  defineProps<{
    apiType?: 'gaode' | 'xinzhi' | 'hefeng' | 'openWeather'
  }>(),
  {
    apiType: 'gaode',
  },
)
console.log(props)
const nowLatitude = ref(0)
const nowLongitude = ref(0)
const nowWeather = ref<WeatherInfo>()
onMounted(() => {
  initGetWeatherInfo().then((res) => {
    const { latitude, longitude } = res
    nowLatitude.value = latitude;
    nowLongitude.value = longitude;
    console.log('获取结果',res)
    nowWeather.value = weatherInfo
  })
})
</script>
<template>
  <div class="weather-container">
    <div>简单的天气预报</div>
  </div>
</template>

<style scoped lang="scss"></style>
